﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Defero.Core.DomainObjects;
using Defero.Web.Models;

namespace Defero.Web.Controllers
{
    [HandleError]
    public class BugTrackerController : DeferoController
    {
        /// <summary>
        /// Objeto de dominio.
        /// </summary>
        IBugTracker BugTracker { get; set; }
        /// <summary>
        /// Constructor default.
        /// </summary>
        /// <param name="bugTracker">Objeto de dominio.</param>
        public BugTrackerController(IBugTracker bugTracker) 
        {
            BugTracker = bugTracker;
        }
        /// <summary>
        /// Accion default para sección.
        /// </summary>
        [AcceptVerbs(HttpVerbs.Get)]
        public ActionResult Index()
        {
            return View();
        }
        /// <summary>
        /// Accion para listado de bugs.
        /// </summary>
        [AcceptVerbs(HttpVerbs.Get)]
        public ActionResult MyBugs() 
        {
            //ApplicationId id = new ApplicationId();
            return View(new MyBugsModel(BugTracker.GetBugs()));
        }

    }
}
